#include<stdio.h>
#include<string.h>
void print_eq(char);
void print_win(char);
int main()
{
    int k = 0;
    scanf("%d", &k);
    getchar();
    char tmp[9];
    char chuzhao[10000];
    int i = 0;
    while(1)
    {
        scanf("%s", &tmp[0]);
        if(strcmp(&tmp[0], "End") == 0)
        {
            break;
        }
        chuzhao[i] = tmp[0];
        i++;
    }
    int j = 0;
    for (j = 1; j <= i; j++)
    {
        if (j % (k+1) == 0)
        {
            print_eq(chuzhao[j - 1]);
        }
        else
        {
            print_win(chuzhao[j - 1]);
        }
    }
    return 0;
}
void print_eq(char c)
{
    if(c=='C')
    {
        printf("ChuiZi\n");
    }
    else if(c=='J')
    {
        printf("JianDao\n");
    }
    else
    {
        printf("Bu\n");
    }
}
void print_win(char c)
{
    if(c=='C')
    {
        printf("Bu\n");
    }
    else if(c=='J')
    {
        printf("ChuiZi\n");
    }
    else
    {
        printf("JianDao\n");
    }
}